

public class ChipPin implements Pin {
	private String name;
	private Chip parent;
	private WirePin partner;

	@Override
	public WorkspaceObj getParent() {
		return parent;
	}

	@Override
	public void setParent(WorkspaceObj p_parent) {
		if(p_parent instanceof Chip) parent = (Chip) p_parent;
	}
	
	@Override
	public Pin getPartner() {
		return partner;
	}

	@Override
	public void setPartner(Pin p_partner) {
		if(p_partner instanceof WirePin) partner = (WirePin) p_partner;
	}
	
	@Override
	public Chip getChip() {
		return parent;
	}

	@Override
	public Wire getWire() {
		if (partner.getParent() instanceof Wire){
			return (Wire) partner.getParent();
		}
		return null;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String p_name) {
		name = p_name;
	}

	@Override
	public boolean isInput() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isOutput() {
		// TODO Auto-generated method stub
		return false;
	}
	
	public ChipPin(String chipName, Chip chipParent, WirePin wirePartner){
		name = chipName;
		parent = chipParent;
		partner = wirePartner;
	}

}
